package com.googlecode.jtoy.patterns.facade;

class FilesDrawer {

	private boolean open = false;

	/** (getter for open) */
	public boolean isOpen() {

		System.out.println("files drawer is " + (open ? "open" : "close"));
		return open;
	}

	public void open(Integer key) {

		if (key == 123456) {
			System.out.println("open files drawer.");
			this.open = true;
		}
	}

	public Object getFile() {

		if (open) {
			System.out.println("get files...");
			return "important file";
		}
		return null;
	}

	public void close() {

		this.open = false;
		System.out.println("close files drawer.");
	}
}
